package com.jcroke.PC32.basetransform;

import java.util.LinkedHashMap;

import com.jcroke.DACGraph.Pnode;
import com.jcroke.PC32.datum.Datum;

/**
 * 
 * @author jcroke
 *
 */
public final class Leaf extends Transformer {

	public void prepare(Pnode pnode) {
		this._pnode = pnode;
		System.out.println("[Prepare] Leaf runnning prepare on: " + _pnode.getNodeName());

		String sourcePnode = Pnode.substrIRI(pNode().getInputSignature().get(0).getSourcePnode());
		String sourceAddr = pNode().getInputSignature().get(0).getSourcePin();

		String localAddr = pNode().getInputSignature().get(0).getLocalPin();
		Datum value = uMem().read(sourcePnode, sourceAddr);
		uMem().write(pNode().getNodeName(), localAddr, value);
	}

	public LinkedHashMap<String, Datum> receive() {
		return null;
	}

	public void execute() {
	}
}
